package xyz.syyrjx.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.syyrjx.entity.ResultInfo;
import xyz.syyrjx.entity.User;

/**
 * @author 大地崩坏苍蝇兽
 * @date 2022/10/11 - 21:29
 */
@FeignClient("redis-remote-server")
public interface RedisRemoteService {
    @RequestMapping("/token/set")
    void setToken(@RequestParam("token") String token, @RequestBody User user);
    @RequestMapping("/token/get")
    ResultInfo<User> getUser(@RequestBody String token);

    @RequestMapping("/black/exists")
    ResultInfo<String> isInBlack(@RequestParam String identity);
    @RequestMapping("black/add")
    public ResultInfo<String> blackAdd(@RequestParam String ip);
    @RequestMapping("black/count")
    public ResultInfo<Long> blackCount(@RequestParam String ip);
}
